package com.ll.stringbufferdemo;

/**
 * @author 刘龙
 * @version 1.0
 */
public class StringBuffer01 {
    public static void main(String[] args) {
        // String => StringBuffer
        String s = "hello";

        // 方式1
        StringBuffer stringBuffer = new StringBuffer(s);
        // 方式2
        StringBuffer stringBuffer1 = new StringBuffer();
        stringBuffer1.append(s);

        // StringBuffer => String
        //方式1:
        String str = stringBuffer.toString();
        String str1 = new String(stringBuffer);
    }
}
